class ParamsError(Exception):
    pass

def sub(a, b):
    try:
        return a / b
    except ZeroDivisionError:
        raise ParamsError("分母不可以为0")
    finally:
        print("sub end")

sub(3, 0)